package 笔试记录.M10day11游卡;

import java.util.Scanner;

public class Main1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(solve(n));
    }

    public static int solve(int n){
        if(n < 3){
            return n;
        }else if(n == 3){
            return 4;
        }else {
            return solve(n - 1) + solve(n - 2) + solve(n - 3);
        }
    }
}
